XPath, and more broadly, XQuery, is a programming and query language designed to select nodes from XML documents, and more generally to query XML data repositories. In a highly-distributed data repository system implemented as an XML database, such as a cloud or other multi-tenant environment, typically there is no notion of a centralized server, or “global” database view against which queries may be executed to query the entire repository from a single view. In other words, XQuery lacks the capability to model or describe a persistent state of a database, as such. XQuery does support access collections of nodes at runtime, which could be said to be analogous to the persistent state of a database. However, even such collections have no detailed database semantics, and XQuery provides no functionality to statically declare such collections. This is generally because XQuery lacks the information (both static and dynamic) that is required for proper compilation and execution against such collections. Further XQuery lacks operations to create and modify such collections, or to declare and manage access structures, such as through the use of indexes.
When queries are executed against a distributed repository, such as an XML repository, there is no existing way to limit the body of data or section of the repository where the query needs to be executed, or otherwise pinpoint or focus on a target section of the repository to be searched. This problem is exacerbated in XML repositories, as such repositories are organized into hierarchical collections. Collections are sequences of nodes that are potentially available using the fn:collection function.
Turning to the multi-tenant or cloud scenario, the nodes or the collections of a repository may typically be organized on a tenant-by-tenant basis, so a tenant executing a query typically has no wish to, and ideally will be prevented from, running the query on other tenant's data.
There is a need, therefore, for an improved method, article of manufacture, and apparatus for more targeted and efficient querying of data in XML data systems.